package tote.model;

import java.io.Serializable;

import javax.persistence.Column;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

public class UserBetByGroupPK implements Serializable {
    private static final long serialVersionUID = 5964272061457723073L;

    @Column(name = "username")
    private String username;

    @Column(name = "teamid")
    private Integer teamid;

    public void setUsername(String username) {
	this.username = username;
    }

    public String getUsername() {
	return username;
    }

    public boolean equals(Object other) {
	if (!(other instanceof UserBetByGroupPK))
	    return false;
	UserBetByGroupPK castOther = (UserBetByGroupPK) other;
	return new EqualsBuilder().append(this.getUsername(), castOther.getUsername()).append(this.getTeamid(),
		castOther.getTeamid()).isEquals();
    }

    public int hashCode() {
	return new HashCodeBuilder().append(getUsername()).append(getTeamid()).toHashCode();
    }

    public void setTeamid(Integer teamid) {
	this.teamid = teamid;
    }

    public Integer getTeamid() {
	return teamid;
    }
}
